package com.lecyon.farm.controller;

import com.lecyon.farm.base.BaseRequestVo;
import com.lecyon.farm.entity.elasticsearch.GpsPictureInformation;
import com.lecyon.farm.service.IGpsPictureInformationService;
import com.lecyon.farm.vo.query.QueryGpsPictureInformationVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author Yao Zheng
 * @Date 2020/4/18 16:49
 */
@RestController
@RequestMapping("/gps-picture-information")
@Api(tags = "GPS图片信息")
@ResponseBody
@CrossOrigin
public class GpsPictureInformationController {

    private IGpsPictureInformationService gpsPictureInformationService;

    @Autowired
    public GpsPictureInformationController(IGpsPictureInformationService gpsPictureInformationService) {
        this.gpsPictureInformationService = gpsPictureInformationService;
    }

    @ApiOperation(value = "查询列表(F0101)", notes = "查询列表(不分页)，author:YaoZheng")
    @PostMapping(value = "/getList")
    public List<GpsPictureInformation> getPageList(@RequestBody @Valid BaseRequestVo<QueryGpsPictureInformationVo> vo) {
        QueryGpsPictureInformationVo queryCondition = vo.getEntity(QueryGpsPictureInformationVo.class);
        return gpsPictureInformationService.getList(queryCondition);
    }

}
